<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

use Illuminate\Support\Facades\Route;

Route::group(['prefix' => 'api/v2'], function () {

    Route::group(['namespace' => 'Drivers\V2'], function () {

        Route::post('login', 'LoginController@login'); //登录注册
     //   Route::post('ceshi', 'LoginController@ceshi'); //测试

        /**
         * 图片上传
         */
        Route::group(['namespace'=>'Common'],function (){

            Route::post('uploads', 'UploadController@uploadImg'); //图片上传

        });
        Route::group(['namespace'=>'Drivers'],function (){

            Route::post('forget_password', 'UserController@Forget_password'); //忘记密码

        });
        /**
         * 版本跟新
         */
        Route::group(['namespace'=>'Index'],function (){

            Route::post('version_status', 'IndexController@version_status'); //版本检测

        });
        Route::group(['namespace' => 'Drivers'], function () {

            Route::post('region', 'DriversController@region'); //地址
        });

        /**
         * 城市
         */
        Route::group(['namespace'=>'City'],function (){
            Route::post('city/lists', 'CityController@lists'); //城市列表
            Route::post('city/service_city', 'CityController@service_city'); //城市列表
            Route::post('drivers/driversid', 'CityController@set_id'); //缓存司机接单城市ID集合

        });

        Route::group(['middleware' => 'auth:api'], function () {

            Route::get('/ws', function () {
                return 'websocket';
            });

            /**
             * 司机资料提交信息
             */
            Route::group(['namespace' => 'Drivers'], function () {
                Route::post('drivers_after', 'DriversController@drivers_ubmission_after'); // 司机资料提交中途保存退出
                Route::post('drivers_continue', 'DriversController@drivers_continue'); // 继续填写资料
                Route::post('drivers/bmission', 'DriversController@drivers_ubmission'); //司机认证资料提交
                Route::post('drivers/status', 'DriversController@drivers_status'); //司机审核状态查看
                Route::post('drivers/bind_driver', 'DriversController@bind_driver'); //司机审核状态查看
                Route::post('linkman_add', 'DriversController@linkman_add'); //添加紧急联系人
                Route::post('licence/lists', 'LicenceController@LicenceList'); //驾照类型列表
                Route::post('drivers/service', 'DriversController@service'); //业务类型
                Route::post('drivers/licence_list', 'DriversController@licence_list'); //准驾车型

                //代驾ve

                Route::post('drivers/driving', 'DriversController@valet_driver_add'); //代驾资料提交
                Route::post('drivers/info', 'DriversController@valet_driver_data'); //代驾资料回显
                Route::post('drivers/company_list', 'DriversController@company_list'); //公司列表



            });
            /**
             * 用户
             */
            Route::group(['namespace'=>'Drivers'],function (){
                Route::post('user_info', 'UserController@read'); // 用户信息
                Route::post('drivers/modification', 'UserController@modification'); //设置密码
                Route::post('password_check', 'UserController@password_check'); //检测密码设置
                Route::post('password_edits', 'UserController@password_edits'); //修改密码
                Route::post('drivers/wallet', 'UserController@wallet'); //钱包
                Route::post('drivers/wallet_list', 'UserController@wallet_list'); //账户明细
                Route::post('driver/wallet_details', 'UserController@driver_wallet_details'); // 提现详情/结算详情
            });

            /**
             * 车辆管理
             */
            Route::group(['namespace'=>'Car'],function (){
                Route::post('car_list', 'CarController@lists'); // 车辆列表
                Route::post('car_edits', 'CarController@edits'); // 车辆编辑
                Route::post('car_brand', 'CarBrandController@car_brand'); // 车辆品牌
                Route::post('search_drivers', 'CarController@add_drivers'); // 查询司机是否存在
                Route::post('car_dels', 'CarController@drivers_car_int'); // 转让司机 ,删除司机
                Route::post('car_status', 'CarController@car_status'); // 车辆状态查看
                Route::post('car_edit_status', 'CarController@car_edit_status'); // 修改司机出车状态


            });
            /**
             * 订单管理
             */
            Route::group(['namespace'=>'Order'],function (){
                Route::post('order_list', 'OrderController@lists'); // 订单列表
                Route::post('order_details', 'OrderController@order_details'); // 订单详情
                Route::post('listening_info', 'OrderController@driverMenu'); // 选单
                Route::post('order_details_show', 'OrderController@order_details_show'); // 订单详情
                Route::post('cancellation_of_order', 'OrderController@cancellation_of_order'); // 取消订单
                Route::post('driver/collection', 'OrderController@InitiateCollection'); // 司机发起收款附加费用计算
                Route::post('driver/bill', 'OrderController@DriverConfirmsBill'); // 乘客费用计算

            });

            /**
             * 提现管理
             */
            Route::group(['namespace'=>'Drivers'],function (){

                Route::post('drivers/withdraw_after', 'WithdrawController@withdraw_after'); // 提现申请
                Route::post('drivers/driver_wallet_list', 'WithdrawController@driver_wallet_list'); // 钱包明细
                Route::post('drivers/driver_wallet_add', 'WithdrawController@driver_wallet_add'); // 添加账号
                Route::post('drivers/driver_wallet_del', 'WithdrawController@driver_wallet_del'); // 删除
                Route::post('drivers/driver_wallet_status', 'WithdrawController@driver_wallet_status'); // 删除
            });

            /**
             * 首页
             */
            Route::group(['namespace'=>'Index'],function (){

                Route::post('index/order_count', 'IndexController@index_list_count'); // 首页统计数据
                Route::post('index/indexs', 'IndexController@index_list_count'); // 首页统计数据
                Route::post('index/order_status', 'IndexController@order_status'); // 订单状态
                Route::post('index/driver_count', 'IndexController@driver_count'); // 订单状态
                Route::post('index/status', 'IndexController@index_list_count_pass_status'); // 接口整合

            });

        });

    });
});
